package com.wis.service.impl;

import com.wis.entity.UserEntity;
import com.wis.mapper.UserMapper;
import com.wis.service.UserService;
import com.wis.util.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public CommonResult selectAll() {
        List<UserEntity> UserEntityList = userMapper.selectAll();
        return CommonResult.build(200, "ok", UserEntityList.size(), UserEntityList);
    }

    @Override
    public CommonResult selectByName(String name, Integer type, Integer page, Integer limit) {
        List<UserEntity> UserEntityList = userMapper.selectByName(name,type,page-1,limit);
        return CommonResult.build(200, "ok", UserEntityList.size(), UserEntityList);
    }
}
